#include"list.h"
#include<iostream>
using namespace std;

void test_list1()
{
	My_Stl::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	for (auto& e : lt)
	{
		e++;
		cout << e << " ";
	}
	cout << endl;
	cout << lt.size() << endl;
	My_Stl::list<int>::iterator it = lt.begin();
	lt.pop_back();
	lt.pop_back();
	while (it != lt.end())
	{
		cout << *it << " ";

		++it;
	}
	cout << endl;
	cout << lt.empty() << endl;
}

void test_list2()
{
	My_Stl::list<int> lt;
	lt.push_front(1);
	lt.push_front(2);
	lt.push_front(3);
	lt.push_front(4);
	//for (auto& e : lt)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;
	//lt.pop_front();
	//lt.pop_front();
	//for (auto& e : lt)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;
	//lt.clear();
	//for (auto& e : lt)
	//{
	//	cout << e << " ";
	//}
	//cout << endl;

	My_Stl::list<int> lt1;
	lt1 = lt;
	for (auto& e : lt1)
	{
		cout << e << " ";
	}
	cout << endl;
}

int main()
{
	test_list2();
	return 0;
}